<?php
namespace common\models\address;

use common\models\Common;
use common\models\user\User;

/**
 * Created by PhpStorm.
 * Time: 4:12 PM
 */
class UserAddress extends Common
{
    public static function tableName()
    {
        return '{{%user_address}}';
    }
    
    public function getUser() {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }
    public function getProvince() {
        return $this->hasOne(ConfigAddress::className(), ['id' => 'province_id']);
    }
    public function getCity() {
        return $this->hasOne(ConfigAddress::className(), ['id' => 'city_id']);
    }
    public function getArea() {
        return $this->hasOne(ConfigAddress::className(), ['id' => 'area_id']);
    }

}